package com.abc.pay.client;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ResourceBundle;

public abstract class MerchantParaFactory {
    private ResourceBundle iResourceBundle = null;

    public MerchantParaFactory() {
    }

    public abstract void refreshConfig() throws TrxException;

    public abstract MerchantPara getMerchantPara() throws TrxException;

    public BufferedWriter getTrxLogFile() throws TrxException {
        return this.getTrxLogFile("TrxLog");
    }

    public BufferedWriter getTrxLogFile(String aFileName) throws TrxException {
        BufferedWriter tLogFile = null;
        String tFileName = "";

        try {
            HiCalendar tHiCalendar = new HiCalendar();
            tFileName = this.getMerchantPara().getLogPath() + System.getProperty("file.separator") + aFileName + tHiCalendar.toString(".%Y%m%d.log");
            tLogFile = new BufferedWriter(new FileWriter(tFileName, true));
            return tLogFile;
        } catch (IOException var5) {
            throw new TrxException("1004", "无法写入交易日志文档", " - 系统无法写入交易日志至[" + tFileName + "]中!");
        }
    }
}
